package apIExercise.io;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class WinteString {
    public static void main(String[] args) throws IOException {
        /*
        FileOutputStream fis=new FileOutputStream("./afa.txt");
        String line="已有的事，后必再有。已行的事，后必再行.";
        byte[] data=line.getBytes(StandardCharsets.UTF_8);
        fis.write(data);
        fis.write("阿芬爱上了阿强。".getBytes(StandardCharsets.UTF_8));
        System.out.println("添加成功");
        fis.close();

         */
        FileOutputStream fos=new FileOutputStream("./afe.txt");
        String line="阿芬爱上了安全!";
        byte[] data=line.getBytes(StandardCharsets.UTF_8);
        fos.write(data);
        fos.write("奥特曼打怪兽！".getBytes(StandardCharsets.UTF_8));
        System.out.println("书写完毕！");
        fos.close();


    }
}
